#include <iostream>
#include "LinuxHardwareInfo.h"
int main()
{
    LinuxHardwareInfo info;

    std::cout << "*************************CPU信息*************************" << std::endl;

    std::vector<CPUInfo> cpuInfos;
    info.GetProcessorAllInfo(cpuInfos);

    for (const auto& cpuInfo : cpuInfos)
    {
        std::cout << "-------------------------" << std::endl;
        std::cout << "processor: " << cpuInfo.processor_ << std::endl;
        std::cout << "Vendor ID: " << cpuInfo.vendor_id_ << std::endl;
        std::cout << "CPU Family: " << cpuInfo.cpu_family_ << std::endl;
        std::cout << "Model: " << cpuInfo.model_ << std::endl;
        std::cout << "Model Name: " << cpuInfo.model_name_ << std::endl;
        std::cout << "Stepping: " << cpuInfo.stepping_ << std::endl;
        std::cout << "Microcode: " << cpuInfo.microcode_ << std::endl;
        std::cout << "CPU MHz: " << cpuInfo.cpu_freq_ << std::endl;
        std::cout << "Cache Size: " << cpuInfo.cache_size_ << std::endl;
        std::cout << "Physical ID: " << cpuInfo.physical_id_ << std::endl;
        std::cout << "Siblings: " << cpuInfo.siblings_ << std::endl;
        std::cout << "Core ID: " << cpuInfo.core_id_ << std::endl;
        std::cout << "CPU Cores: " << cpuInfo.cpu_cores_ << std::endl;
        std::cout << "clflush size: " << cpuInfo.clflush_size_ << std::endl;
        std::cout << "-------------------------" << std::endl;
    }

    std::cout << "*************************CPU信息*************************" << std::endl;

    std::cout << "*************************磁盘信息*************************" << std::endl;

    std::vector<DiskStatsInfo> disk_infos;
    info.GetDiskStatsAllInfo(disk_infos);

    for (const auto& diskStats : disk_infos) 
    {
        std::cout << "-------------------------" << std::endl;
        std::cout << "主设备号: " << diskStats.major_device_num_ << std::endl;
        std::cout << "次设备号: " << diskStats.minor_device_num_ << std::endl;
        std::cout << "磁盘名称: " << diskStats.device_name_ << std::endl;
        std::cout << "完成的读操作次数: " << diskStats.read_completed_ << std::endl;
        std::cout << "合并读操作次数: " << diskStats.read_merged_ << std::endl;
        std::cout << "读取的扇区总数: " << diskStats.read_sectors_ << std::endl;
        std::cout << "花费在读操作上的时间: " << diskStats.read_time_spent_ << std::endl;
        std::cout << "完成的写操作次数: " << diskStats.write_completed_ << std::endl;
        std::cout << "合并写操作次数: " << diskStats.write_merged_ << std::endl;
        std::cout << "写入的扇区总数: " << diskStats.write_sectors_ << std::endl;
        std::cout << "花费在写操作上的时间: " << diskStats.write_time_spent_ << std::endl;
        std::cout << "-------------------------" << std::endl;
    }
    std::cout << "*************************磁盘信息*************************" << std::endl;

    std::cout << "*************************BIOS信息*************************" << std::endl;

    BIOSMoreInfo bios_info;
    info.GetBIOSAllInfo(bios_info);

    std::cout << "BIOS版本号: " << bios_info.version_ << std::endl;
    std::cout << "BIOS供应商: " << bios_info.vendor_ << std::endl;
    std::cout << "BIOS发布日期: " << bios_info.date_ << std::endl;
    std::cout << "BIOS 在内存中的物理地址: " << bios_info.address_ << std::endl;
    std::cout << "BIOS运行时占用的内存大小: " << bios_info.runtime_size_ << std::endl;
    std::cout << "存储BIOS固件的ROM(只读存储器)容量: " << bios_info.rom_size_ << std::endl;
    std::cout << "BIOS 的修订版本号: " << bios_info.bios_revision_ << std::endl;
    std::cout << "主板固件的版本号: " << bios_info.firmware_revisioin_ << std::endl;
    std::cout << "*************************BIOS信息*************************" << std::endl;
 
    std::cout << "*************************主板信息*************************" << std::endl;
 
    BaseboardMoreInfo board_info;
    info.GetBoardAllInfo(board_info);
 
    std::cout << "主板版本号: " << board_info.version_ << std::endl;
    std::cout << "主板供应商: " << board_info.vendor_ << std::endl;
    std::cout << "主板型号: " << board_info.name_ << std::endl;
    std::cout << "主板序列号: " << board_info.serial_num_ << std::endl;
    std::cout << "主板资产标签: " << board_info.asset_tag_ << std::endl;
    std::cout << "主板在机箱中的位置: " << board_info.location_in_chassis_ << std::endl;
    std::cout << "主板类型: " << board_info.type_ << std::endl;
    std::cout << "*************************主板信息*************************" << std::endl;

    return 0;
}